package com.itlong.cloud.project.app;

import com.itlong.cloud.POJO.DTO.app.AppGetProjectDTO;
import com.itlong.cloud.POJO.DTO.app.AppTouristDTO;
import com.itlong.cloud.POJO.VO.MessageVO;
import com.itlong.cloud.POJO.VO.app.AppDistinctProjectVO;
import com.itlong.cloud.POJO.VO.app.AppGetProjectUiVO;
import com.itlong.cloud.POJO.VO.app.AppProjectBuildVO;
import com.itlong.cloud.POJO.VO.app.AppProjectRoomVO;
import com.itlong.cloud.POJO.VO.property.PropertyProjectBuildSimpleInfoVO;
import com.itlong.cloud.POJO.VO.property.PropertyProjectRoomInfoVO;
import com.itlong.cloud.POJO.VO.property.PropertyProjectRoomSimpleInfoVO;
import com.itlong.cloud.POJO.VO.property.PropertyProjectUnitSimpleInfoVO;
import com.itlong.cloud.utils.page.Page;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.data.repository.query.Param;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

/**
 *<desc>
 *     新版APP的项目信息接口代理
 *</desc>
 *
 * @createDate 2017/9/29
 */
@FeignClient(name = "project-service")
public interface IAppProjectServiceClient {

    /**
     * <desc>
     *      根据城市名称获取城市id
     * </desc>
     *
     * @param cityName
     * @return
     * @author Jiaqi.X
     * @createDate 2020/05/28
     */
    @RequestMapping(path = "/home/getCityIdByCityName",method = RequestMethod.POST)
    String getCityIdByCityName(@RequestParam("cityName") String cityName);

    /**
     * <desc>
     *     根据城市ID获取启用状态的项目信息（项目编号与项目名称）
     * </desc>
     *
     * @param appGetProjectDTO app获取项目信息传参DTO
     * @return
     * @author cuiduanwu
     * @throws Exception
     * @createDate 2017/9/29
     */
    @RequestMapping(path = "/home/getProjectsInCity",method = RequestMethod.POST)
    List<AppDistinctProjectVO> getProjectsInCity(@RequestBody AppGetProjectDTO appGetProjectDTO) throws  Exception;

    /**
     * <desc>
     *     app2.0根据城市ID获取启用状态的项目信息（项目编号与项目名称）
     * </desc>
     *
     * @param cityId 城市ID
     * @return
     * @author Qiang.S
     * @throws Exception
     * @createDate 2019/06/20
     */
    @RequestMapping(path = "/home/getNewProjectsInCity",method = RequestMethod.POST)
    List<AppProjectBuildVO> getNewProjectsInCity(@RequestParam("cityId") String cityId) throws  Exception;

    /**
     * <desc>
     *     app2.0根据楼栋编号获取单元和房间
     * </desc>
     *
     * @param buildId 楼栋编号
     * @return
     * @author Qiang.S
     * @throws Exception
     * @createDate 2019/06/20
     */
    @RequestMapping(path = "/home/getNewProjectsUnit",method = RequestMethod.POST)
    List<AppProjectRoomVO> getNewProjectsUnit(@RequestParam("buildId") String buildId) throws  Exception;

    /**
     * <desc>
     *     根据国家ID获取启用状态的项目信息（项目编号与项目名称）
     * </desc>
     *
     * @param countryId 国家ID
     * @param pageNo
     * @param pageSize
     * @return
     * @author shengen.T
     * @throws Exception
     * @createDate 2017/9/29
     */
    @RequestMapping(path = "/home/getProjectsInCountry",method = RequestMethod.POST)
    Page<Map<String,Object>> getProjectsInCountry(
            @RequestParam("countryId") String countryId,
            @RequestParam("pageNo") String pageNo,
            @RequestParam("pageSize") String pageSize) throws  Exception;

    /**
     * <desc>
     *     根据项目编号获取启用状态的楼栋信息
     * </desc>
     *
     * @param projectId  项目编号
     * @param pageNo
     * @param pageSize
     * @return
     * @author cuiduanwu
     * @throws Exception
     * @createDate 2017/9/29
     */
    @RequestMapping(path = "/home/getBuildList",method = RequestMethod.POST)
    Page<PropertyProjectBuildSimpleInfoVO> getBuildsInProject(
            @RequestParam("projectId") String projectId,
            @RequestParam("pageNo") String pageNo,
            @RequestParam("pageSize") String pageSize
    ) throws Exception;

    /**
     * <desc>
     *      根据楼栋ID获取启用状态的单元信息
     * </desc>
     * @param buildId  楼栋ID
     * @return
     * @throws Exception
     * @createDate 2017/9/30
     *  @author cuiduanwu
     */
    @RequestMapping(path = "/home/getUnitList",method = RequestMethod.POST)
    Page<PropertyProjectUnitSimpleInfoVO> getUnitsInBuild(@RequestParam("buildId") String buildId) throws  Exception;

    /**
     * <desc>
     *      根据单元ID获取启用状态的房间信息
     * </desc>
     * @param unitId  单元ID
     * @param pageNo
     * @param pageSize
     * @return
     * @throws Exception
     * @createDate 2017/10/9
     * @author cuiduanwu
     */
    @RequestMapping(path = "/home/getRoomList",method = RequestMethod.POST)
    Page<PropertyProjectRoomSimpleInfoVO> getRoomsInUnit(
            @RequestParam("unitId") String unitId,
            @RequestParam("pageNo") String pageNo,
            @RequestParam("pageSize") String pageSize) throws  Exception;

    /**
     * <desc>
     *      根据房间ID获取房间信息
     * </desc>
     * @param roomId  房间ID
     * @return
     * @throws Exception
     * @createDate 2017/10/23
     * @author cuiduanwu
     */
    @RequestMapping(path = "/home/getRoomById",method = RequestMethod.POST)
    PropertyProjectRoomInfoVO getRoomById(@RequestParam("roomId") String roomId);


    /**
     * <desc>
     *      根据用户id获取该用户id下所有项目id集合 多个,号分隔
     * </desc>
     *
     * @param userId 用户id
     * @return
     * @author Jiaqi.X
     * @createDate 2017/11/13
     */
    @RequestMapping(path = "/home/getUserProjectIds")
    String getUserProjectIds(@RequestParam("userId") String userId);

    /**
     * <desc>
     *      设置APP是否被呼叫
     * </desc>
     *
     * @param userId 用户id
     * @param isAllowApp app是否允许被呼叫 0是 1否
     * @return
     * @author Jiaqi.X
     * @createDate 2017/11/13
     */
    @RequestMapping(path = "/home/setAllowApp")
    Integer setAllowApp(@RequestParam("userId") String userId,
                               @RequestParam("isAllowApp") Integer isAllowApp,
                               @RequestParam(value = "projectId",required = false) String projectId);

    /**
     * <desc>
     *      设置电话是否被呼叫
     * </desc>
     *
     * @param projectId 项目id
     * @param userId 用户id
     * @param isAllowPhone 是否允许被呼叫 0是 1否
     * @return
     */
    @RequestMapping(path = "/home/setAllowPhone")
    Integer setAllowPhone(@RequestParam("projectId") String projectId,
                                 @RequestParam("userId") String userId,
                                 @RequestParam("isAllowPhone") String isAllowPhone);

    /**
     * <desc>
     *      设置app登录用户当前项目id
     * </desc>
     *
     * @param userId 用户id
     * @param projectId 项目id
     * @return
     * @author Jiaqi.X
     * @createDate 2017/11/28
     */
    @RequestMapping(path="/home/setCurrentProject")
    Integer setCurrentProject(@RequestParam("userId") String userId,
                              @RequestParam("projectId") String projectId,
                              @RequestParam("projectName") String projectName);

    /**
     * <desc>
     *      获取用户所有的项目id
     * </desc>
     *
     * @param userId 用户id
     * @return
     * @author Jiaqi.X
     * @createDate 2017/12/21
     */
    @RequestMapping(path = "/home/getAllProjects")
    List<String> getAllProjects(@RequestParam("userId") String userId);

    /**
     * <desc>
     *      获取当前用户下所有项目的UI信息
     * </desc>
     *
     * @param projectIds 多个项目编号id，中间以逗号隔开
     * @return
     * @author JuGuang.S
     * @createDate 2018/05/24
     */
    @RequestMapping(path = "/home/getProjectIdUi")
    List<AppGetProjectUiVO> getProjectIdUi(@RequestParam("projectIds") String projectIds, @RequestParam("deviceType") String deviceType);

    /**
     * <desc>
     *      获取用户当前项目下的推送消息
     * </desc>
     *
     * @return 当前项目下的推送消息
     * @createDate 2019/05/30
     * @author wangzhi
     */
    @RequestMapping(path = "/home/getMessageBox")
    Map<String,Object> getMessageBox(@RequestParam("projectId") String projectId, @RequestParam("pageNum") String pageNum,
                                     @RequestParam("msgType") String msgType, @RequestParam("userId") String userId, @RequestParam("url") String url,
                                     @RequestParam(value = "version", required = false) String version) throws Exception;

    /**
     * <desc>
     *      用户读取新消息
     * </desc>
     *
     * @return 1读取成功，0失败
     * @createDate 2019/05/30
     * @author wangzhi
     */
    @RequestMapping(path = "/home/readNewMsg")
    Integer readNewMsg(@RequestParam("msgId") String msgId, @RequestParam("userId") String userId) throws Exception;

    /**
     * <desc>
     *      上传常用楼层
     * </desc>
     *
     * @param projectId 项目编号
     * @param deviceUnique 设备序列号
     * @param loadDeviceOrder 常用楼层名称
     * @return 1成功，0失败
     * @author wangzhi
     * @createDate 2019/10/08
     */
    @RequestMapping(path = "/home/uploadChoiceFloor")
    Integer uploadChoiceFloor(@RequestParam("projectId") String projectId, @RequestParam("deviceUnique") String deviceUnique,
                              @RequestParam("loadDeviceOrder") String loadDeviceOrder, @RequestParam("userId") String userId,
                              @RequestParam(value = "loadPublicOrder",required = false) String loadPublicOrder ) throws Exception;

    /**
     * <desc>
     *      自动切换小区
     * </desc>
     *
     * @param longitude 经度
     * @param latitude 纬度
     * @param userId 用户id
     * @return 标准格式化响应结果
     * @author wangzhi
     * @createDate 2019/10/11
     */
    @RequestMapping(path = "/home/autoMatchProject")
    Map<String,Object> autoMatchProject(@RequestParam("longitude") String longitude, @RequestParam("latitude") String latitude, @RequestParam("userId") String userId) throws Exception;

    /**
     * <desc>
     *      获取用户当前项目下的推送消息包括运营+物业
     * </desc>
     *
     * @return 当前项目下的推送消息
     * @author JuGuang.S
     * @createDate 2018/09/17
     */
    @RequestMapping(path = "/home/getMessageBoxByPropertyAndOperate")
    Map<String,Object> getMessageBoxByPropertyAndOperate(@RequestParam("projectId") String projectId,
                                                         @RequestParam("pageNum") String pageNum,
                                                         @RequestParam("userId") String userId,
                                                         @RequestParam("url") String url) throws Exception;

    /**
     * <desc>
     *      检测项目是否开启蓝牙进场呼梯配置
     * </desc>
     *
     * @param projectId
     * @return
     * @author Jiaqi.X
     * @createDate 2020/04/27
     */
    @RequestMapping(path = "/home/checkProjectBlueToothCall")
    Integer checkProjectBlueToothCall(@RequestParam("projectId") String projectId);

    /**
     * <desc>
     *      根据定位获取最近的开通了游客模式的项目
     * </desc>
     *
     * @return 项目信息
     * @author wangzhi
     * @createDate 2020/04/30
     */
    @RequestMapping(path = "/home/getProjectByLocation")
    Map<String,Object> getProjectByLocation(@RequestBody AppTouristDTO appTouristDTO) throws Exception;

    /**
     * <desc>
     *      获取项目远程开门配置
     * </desc>
     *
     * @param projectId
     * @return
     * @author Juguang.S
     * @createDate 2020/09/17
     */
    @RequestMapping(path = "/home/getNetworkOpenSetting")
    Integer getNetworkOpenSetting(@RequestParam("projectId") String projectId);

    /**
     * <desc>
     *      保存用户项目信息
     * </desc>
     *
     * @param appGetProjectDTO 选择项目参数DTO
     * @return
     * @Author Zhu.yj
     * @createDate  2021/4/6
     */
    @PostMapping("/home/saveUserProject")
    Integer saveUserProject(@RequestBody AppGetProjectDTO appGetProjectDTO) throws Exception;

    /**
     * <desc>
     *      模糊查询项目
     * </desc>
     *
     * @param projectName 项目名称
     * @return
     * @Author Zhu.yj
     * @createDate  2021/4/6
     */
    @PostMapping("/home/getProjectByProjectName")
    List<Map<String, Object>> getProjectByProjectName(@RequestParam(value = "projectName", required = false) String projectName) throws Exception;

    /**
     * <desc>
     *      删除用户项目
     * </desc>
     *
     * @param appGetProjectDTO 删除用户项目信息参数DTO
     * @return
     * @Author Zhu.yj
     * @createDate  2021/4/7
     */
    @PostMapping("/home/deleteUserProject")
    MessageVO deleteUserProject(@RequestBody AppGetProjectDTO appGetProjectDTO) throws Exception;

    /**
     * <desc>
     *      获取项目下的用户类型id和用户类型名称
     * </desc>
     *
     * @param roomId 房间id
     * @return
     * @Author Zhu.yj
     * @createDate  2021/4/17
     */
    @PostMapping("/home/getProjectRoleList")
    List<Map<String, Object>> getProjectRoleList( @RequestParam("roomId") String roomId) throws Exception;

    /**
     * <desc>
     *      获取项目下的用户类型id和用户类型名称
     * </desc>
     *
     * @param projectId 项目id
     * @return
     * @Author Zhu.yj
     * @createDate  2021/4/17
     */
    @PostMapping("/home/getProjectUserRoleList")
    List<Map<String, Object>> getProjectUserRoleList(@RequestParam("projectId") String projectId) throws Exception;

    /**
     * <desc>
     *      获取项目下的用户类型id和用户类型名称
     * </desc>
     *
     * @param projectId 项目id
     * @return
     * @Author Zhu.yj
     * @createDate  2021/4/17
     */
    @PostMapping("/property/getProjectRoleListByProjectId")
    List<Map<String, Object>> getProjectRoleListByProjectId( @RequestParam("projectId") String projectId) throws Exception;

}
